package mysql

import "gorm.io/gorm"

// 用户表

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);unique;not null;comment:用户名;"`
	Password string `gorm:"type:char(32);not null;comment:密码;"`
	Mobile   string `gorm:"type:char(11);not null;comment:手机号;"`
	Salt     string `gorm:"type:varchar(5);not null;comment:盐;"`
}

// 用户实名表

type UserRealName struct {
	gorm.Model
	UserId   int    `gorm:"type:int(11);not null;unique;comment:用户id;"`
	RealName string `gorm:"type:varchar(20);not null;comment:真实姓名;"`
	IdCard   string `gorm:"type:char(18);not null;unique;comment:身份证号;"`
}

// 创建实名

func (u *UserRealName) Create() error {
	return Db.Create(&u).Error
}
